package com.wangshuqi.app;

import com.wangshuqi.spring.*;

@Component
//@Scope("prototype")
public class UserService implements BeanNameAware, InitializingBean, UserInterface {

    @Autowired
    private OrderService orderService;

    private String beanName;

    @Override
    public void test() {
        System.out.println("---->注入orderService属性的Bean对象地址：" + orderService);
        System.out.println("---->UserService类的bean对象名称：" + beanName);
    }

    @Override
    public void setBeanName(String beanName) {
        this.beanName = beanName;
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("userService执行了初始化方法");
    }
}
